home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Graphics / include / bsptree_3d.h < prev    next >
Encoding:
Text File  |  1995-03-26  |  2.1 KB  |  41 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    bsptree.h
  3. //    Date:                    9/25/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a bsp tree
  7. //
  8. //------------------------------------------------------------------------------
  9.  
  10. #include    "split.h"
  11. #include    "listptr_3d.h"
  12.  
  13. #ifndef BSPTREE
  14. #define BSPTREE
  15.  
  16. //------------------------------------------------------------------------------
  17. //    classes
  18. //------------------------------------------------------------------------------
  19. class    bspnode;                                                                                                                                    //    forward declaration
  20.  
  21. //------------------------------------------------------------------------------
  22. class    bsptree                                                                                                                                        //    binary space partition tree class
  23. {                                                                                                                                                                //    begin class definition
  24.     private:                                                                                                                                            //    members internal to this class only
  25.     protected:                                                                                                                                        //    members internal to this class hierarchy
  26.                 bspnode    *node;                                                                                                                    //    pointer to the data for this tree
  27.     public:                                                                                                                                                //    members available externally
  28.                 bsptree (void);                                                                                                                    //    default constructor
  29.                 ~bsptree (void);                                                                                                                //    destructor
  30.                 void        Insert (listptr list, hclass keep, hclass cur);                                    //    insert a polylist list into the tree
  31.                 void        Push (polyptr poly, listptr result, hclass keep, hclass cur);        //    push a polygon through the tree
  32.                 void        Push (listptr list, listptr result, hclass keep, hclass cur);        //    push a polygon list through the tree
  33.                 void        Reduce (void);                                                                                                    //    reduce the tree to only boundary polygons
  34.                 void        Draw (const point_3d    &eye) const;                                                            //    draw the tree to the view
  35.                 bool        RayIntersection (const ray &r, polyptr &poly_hit, point_3d &ipt) const;    //    compute the polygon intersected by a ray
  36. };                                                                                                                                                            //    endclass definition
  37.  
  38. //------------------------------------------------------------------------------
  39.  
  40. #endif //BSPTREE
  41.